<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 18-3-9
 * Time: 上午9:43
 */

namespace common\models;

/**
 * Class FileListInfo
 * @package common\models
 *
 * @property FileListDownloadLog[] $fileListDownloadLogs
 * @property Custom $custom
 */
class FileListInfo extends \common\models\base\FileListInfo
{
    const TYPE_CARD = 0; // 开卡清单文件
    const TYPE_COLLECTION = 1; // 催收
    const TYPE_UNSERCURED_DETAILS= 2; // 未抵押明细
    const TYPE_CALL = 3; // 催缴
    const CARD_ISSUE_MARK_FAILED = 0; //
    const CARD_ISSUE_MARK_SUCCESS = 1; //

    public static function getTypeLabes()
    {
        return [
            self::TYPE_CARD => '地区号、平台编号、担保单位编号、订单号、开卡日期、卡号、姓名、证件类型、证件号码、发卡标志、对账单日、还款日',
            self::TYPE_COLLECTION => '数据日期、地区号、平台编号、担保单位编号、订单号、卡号、姓名、证件类型、证件号码、卡余额、最优还款额、累计违约次数、连续违约次数、经办支行、分期业务种类',
            self::TYPE_UNSERCURED_DETAILS => '地区号、平台编号、担保单位编号、订单号、卡号、姓名、证件类型、证件号码、分期金额、汇总笔数、汇总金额',
            self::TYPE_CALL => '数据日期、地区号、平台编号、担保单位编号、订单号、卡号、姓名、证件类型、证件号码、卡余额、最优还款额、累计违约次数、连续违约次数、经办支行、分期业务种类、催缴情况',
        ];
    }

    public static function getCardIssueMark()
    {
        return [
            self::CARD_ISSUE_MARK_FAILED => '开卡失败',
            self::CARD_ISSUE_MARK_SUCCESS => '开卡成功',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getFileListDownloadLogs()
    {
        return $this->hasMany(FileListDownloadLog::className(), ['file_list_info_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getCustom()
    {
        return $this->hasOne(Custom::className(), ['id' => 'custom_id']);
    }
}